/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package br.zeos.bean;

import br.zeos.ZDataSource;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.HashMap;
import javax.swing.JLabel;

/**
 *
 * @author virtual
 */
public class ZLabel extends JLabel implements ActionListener{
   
    private ZDataSource origem = null;
    private String FieldName = "";

    public ZDataSource getDataSource() {
        return origem;
    }

    public void setDataSource(final ZDataSource origem) {
        this.origem = origem;
        this.origem.addUpdateListener(this);
    }


    public String getFieldName() {
        return FieldName;
    }

    public void setFieldName(String FieldName) {
        this.FieldName = FieldName;
    }

    @Override
    public void actionPerformed(ActionEvent ae) {
        this.setText(origem.getLine().get(this.getFieldName().toUpperCase()));
    }
 
}
